//
//  NSArray+Util.h
//  云成绩
//
//  Created by Apple1 on 2017/3/27.
//  Copyright © 2017年 zj. All rights reserved.
//

#import <Foundation/Foundation.h>

//typedef BOOL(^ArrayFilterCondition)(id item);

@interface NSArray<__covariant ObjectType> (Util)

- (NSInteger)find:(BOOL(NS_NOESCAPE ^)(ObjectType item))condition;

- (NSArray<ObjectType> *)filter:(BOOL(NS_NOESCAPE ^)(ObjectType item))condition;

- (NSArray *)flatMap:(id(NS_NOESCAPE ^)(ObjectType item))condition;

- (NSArray *)map:(id(NS_NOESCAPE ^)(ObjectType item))condition;

- (void)forEach:(void(NS_NOESCAPE ^)(ObjectType item))condition;

- (id)reduce:(id __nullable)initialValue andCondition:(id (NS_NOESCAPE ^)(id __nullable initialValue, ObjectType item))condition;

@end
